package pro.cherish.knowledgeumldesignpattern.designPattern.com.cherish.prototype;

/**
 * 原型链模式
 */
public class client {
    public static void main(String [] args) throws CloneNotSupportedException {
        Sheep doli = new Sheep("多利");
        System.out.println(doli);
        Sheep clone = (Sheep)doli.clone();
        System.out.println(clone);
        clone.setName("clonename");
        System.out.println(clone);
//        以上为浅克隆，如果属性中，比如例中的Data对象，还是同一个引用



    }
}
